<!-- $Id: article_list.htm 16783 2009-11-09 09:59:06Z liuhui $ -->

{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}

<div class="form-div">
  <form action="javascript:searchContent()" name="searchForm" >
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
	{$lang.from_node}：
    <select name="cid" >
		<option value="0">-{$lang.all}-</option>
		{foreach from="$nodes" item="node"}
		<option value="{$node.id}" {if $node.id eq $cid}selected{/if}>{$node.name}</option>
		{/foreach}
    </select>
	{$lang.goods_cat}：
    <select name="cat_id" >
		<option value="0">-{$lang.all}-</option>
		{foreach from="$good_types" item="gt"}
		<option value="{$gt.cat_id}" {if $gt.cat_id eq $cat_id}selected{/if}>{$gt.cat_name}</option>
		{/foreach}
    </select>
	
	{$lang.implode_status}：
    <select name="is_import" >
		<option value="-1">-{$lang.all}-</option>
		<option value="0" {if $is_import eq '0'}selected{/if}>{$lang.no_implode}</option>
		<option value="1" {if $is_import eq '1'}selected{/if}>{$lang.has_implode}</option>
    </select>
	{$lang.goods_title}：
     <input type="text" name="keyword" id="keyword" value="{$keyword}" placeholder="{$lang.goods_keyword}"/>
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<form method="POST" action="collection.php?act=content_import&mode=multi" name="listForm">
<!-- start cat list -->
<div class="list-div" id="listDiv">
{/if}

<table cellspacing='1' cellpadding='3' id='list-table'>
<tr >
	<th><input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
      <a href="javascript:listTable.sort('article_id'); ">{$lang.id}</a></th>
	<th>{$lang.sign}</th>
	<th>{$lang.node}</th>
	<th>{$lang.has_implode}</th>
	<th>{$lang.title}</th>
	<th>{$lang.op_cat}</th>
	<th>{$lang.operation}</th>
</tr>
{foreach from="$list" item="cnt" key="k"}

	<tr>&nbsp;
	<!--<input type="hidden" name="contentid[]" value="{$cnt.id}"/> -->
	<td align="center"><span><input name="checkboxes[]" type="checkbox" value="{$cnt.id}" />{$cnt.id}</span></td>
	<td align="center">{$cnt.sign}</td>
	<td align="center">{$cnt.nodename}</td>
	<td align="center"><span><img src="images/{if $cnt.is_import eq '1'}yes{else}no{/if}.gif"/></span></td>
	
	<td align="center"><a href="{$cnt.url}" target="_blank">{$cnt.title}<a></td>
	<td align="center">
		{if $cnt.is_import eq 1}
			{$lang.hasconfig}
		{else}
		<select name="category[{$cnt.id}]">
			<option value="0">{$lang.select_please}</option>
			{foreach from="$category" item="cate"}
			<option value="{$cate.cat_id}">{$cate.cat_name}</option>
			{/foreach}
		</select>
		{/if}
	</td>
	<td align="center">
		<a href="javascript:;" onclick="showmore('desc{$k}');">{$lang.view}</a>
		{if $cnt.is_import eq '1'}<a href="../goods.php?id={$cnt.goods_id}" target="_blank" title="{$lang.view_detail_tips}">| {$lang.view_detail}</a>{/if}
		<a href="javascript:;" onclick="confirm('{$lang.cnt_delete_confirm}?')?location.href='collection.php?act=content_delete&mode=one&contentid={$cnt.id}':'';">| {$lang.delete}</a>
		<a href="javascript:;" onclick="confirm('{$lang.cnt_delete_confirm}?')?location.href='collection.php?act=content_delete&mode=all&contentid={$cnt.id}':'';">| {$lang.clear}</a>
		{if $cnt.is_import neq '1'}<a href="collection.php?act=content_import&mode=one&contentid={$cnt.id}">| {$lang.implode}</a>{/if}
	</td>
	</tr>
	
	<tr >
    <td align="left" nowrap="true" colspan="7">
	<div id="desc{$k}" style="display:none;">
		{foreach from="$cnt.common_content" item="com" key="kc"}
			{$kc}=>{$com|truncate:100}<br/>
		{/foreach}
		{foreach from="$cnt.attr_content" item="attr" key="ka"}
			{$ka}=>{$attr[1]|truncate:100}<br/>
		{/foreach}
	</td>
	</div>
	</tr>


   {foreachelse}
	<tr>
	<td colspan="7" align="center">{$lang.no_data}</td>
	</tr>
  {/foreach}
  <tr>&nbsp;
    <td align="right" nowrap="true" colspan="8">{include file="page.htm"}</td>
  </tr>
</table>

{if $full_page}
</div>

<div>
  <input type="hidden" name="act" value="contentbatch" />
  <label>{$lang.allcategory}：</label>
  <select name="allcategory" id="selCategory">
	<option value="0">{$lang.select_please}</option>
	{foreach from="$category" item="cate"}
	<option value="{$cate.cat_id}">{$cate.cat_name}</option>
	{/foreach}
  </select>
  
  <select name="type" id="selAction" onchange="changeAction()">
    <option value="">-{$lang.op_select}-</option>
    <option value="batch_implode">{$lang.batch_implode}</option>
    <option value="all_implode">{$lang.all_implode}</option>
    <option value="batch_delete">{$lang.batch_delete}</option>
    <option value="all_delete">{$lang.all_delete}</option>
	<option value="batch_delete_withpic">{$lang.batch_delete_withpic}</option>
    <option value="all_delete_withpic">{$lang.all_delete_withpic}</option>
  </select>
  <input type="submit" value="{$lang.button_submit}" id="btnSubmit" name="btnSubmit" class="button"  />
</div>

</form>
<!-- end cat list -->
<script type="text/javascript" language="JavaScript">

  listTable.recordCount = {$record_count};
  listTable.pageCount = {$page_count};

  listTable.filter.act="content_query";

  {foreach from=$filter item=item key=key}
  listTable.filter.{$key} = "{$item}";
  {/foreach}
   listTable.filter.act="content_query";
  
  {literal}
  onload = function()
  {
    // 开始检查订单
    startCheckOrder();
  }
	/**
   * @param: bool ext 其他条件：用于转移分类
   */
  function confirmSubmit(frm, ext)
  {
      if (frm.elements['type'].value == 'batch_delete'||frm.elements['type'].value == 'batch_delete_withpic'||frm.elements['type'].value == 'all_delete'||frm.elements['type'].value == 'all_delete_withpic')
      {
          return confirm('{$lang.delete_confirm_tips}!');
      }
      else if (frm.elements['type'].value == 'batch_implode'||frm.elements['type'].value == 'all_implode')
      {
          return confirm('{$lang.batch_implode_tips}？');
      }
      else if (frm.elements['type'].value == '')
      {
          return false;
      }
      else
      {
          return true;
      }
  }
	 
function changeAction()
  {
		
      var frm = document.forms['listForm'];

      // 切换分类列表的显示
     // frm.elements['target_cat'].style.display = frm.elements['type'].value == 'move_to' ? '' : 'none';

      if (!document.getElementById('btnSubmit').disabled &&
          confirmSubmit(frm, false))
      {
          frm.submit();
      }
  }

 /* 搜索采集内容 */
 function searchContent()
 {
    listTable.filter.keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
    listTable.filter.is_import = parseInt(document.forms['searchForm'].elements['is_import'].value);
    listTable.filter.page = 1;
	listTable.filter.cat_id=parseInt(document.forms['searchForm'].elements['cat_id'].value);
	listTable.filter.cid=parseInt(document.forms['searchForm'].elements['cid'].value);
	
	//listTable.filter.cid={$node.id};
	 listTable.filter.act="content_query";
    listTable.loadList();
 }


function showmore(id)
	{
		var $more=document.getElementById(id);
		
		if($more.style.display=="none")
			$more.style.display="block";
		else
			$more.style.display="none";
	}
	
	
  

{/literal}
</script>
{include file="pagefooter.htm"}
{/if}
